package ints

import (
	"github.com/gin-gonic/gin"
	"gogs.xiaoyuanjijiehao.com/antlinker/antcms/app/ginsrv/oplog"
	"gogs.xiaoyuanjijiehao.com/antlinker/antcms/core"
)

// Init 初始化
func Init(route *gin.RouterGroup, d core.CmsDomain) {
	typctrl := createTypCtrl(d)
	tr := route.Group("types")
	tr.GET("", oplog.OplogRoute("cms/ints/type/list", "获取互动类型列表", typctrl.getTypePageList))
	route.GET("typeall", oplog.OplogRoute("cms/ints/typeall", "获取所有互动类型列表", typctrl.getTypeAll))
	tr.POST("", oplog.OplogRoute("cms/ints/type/add", "新增互动类型", typctrl.add))

	tr.GET(":code", oplog.OplogRoute("cms/ints/type/getone", "获取指定互动类型", typctrl.getType))
	tr.DELETE(":code", oplog.OplogRoute("cms/ints/type/delete", "删除互动类型", typctrl.delete))
	tr.PUT(":code/recover", oplog.OplogRoute("cms/ints/type/recover", "恢复互动类型", typctrl.recover))
	tr.PUT(":code/lock", oplog.OplogRoute("cms/ints/type/lock", "锁定互动类型", typctrl.lock))
	tr.PUT(":code/unlock", oplog.OplogRoute("cms/ints/type/unlock", "解锁互动类型", typctrl.unlock))
	tr.DELETE(":code/destroy", oplog.OplogRoute("cms/ints/type/unlock", "解锁互动类型", typctrl.destroy))
	tr.PUT(":code", oplog.OplogRoute("cms/ints/type/updatedesc", "修改互动类型", typctrl.updateDesc))
}
